package com.tourism.home.exceptions;


import com.tourism.home.enums.ResultEnum;

/**
 * @author linli
 * at 18-3-31 下午3:27
 * 全局异常
 */

public class GlobalException extends RuntimeException {


    //异常码
    private Integer code;

    //异常信息
    private String message;


    public GlobalException(){
    }

    public GlobalException(Integer code, String message){
        this.code = code;
        this.message = message;
    }

    public GlobalException(ResultEnum resultEnum){
        this.message = resultEnum.getMessage();
    }

    @Override
    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }


}
